<nav id="header" class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                    data-target="#bs-example-navbar-collapse-1">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#"><b>BBS</b></a>
        </div>

        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav">
                <li id="tab_1">
                    <a href="{:U('Article/index')}"><b>首页</b></a>
                </li>
                <li id="tab_2">
                    <a href="{:U('Sort/index')}"><b>分类</b></a>
                </li>
                <li id="tab_3">
                    <a href="{:U('User/index')}"><b>会员</b></a>
                </li>
                <if condition="$Think.session.uid neq null">
                    <li id="tab_4">
                        <a href="{:U('Article/add')}"><b>发表</b></a>
                    </li>
                </if>

            </ul>
            <form class="navbar-form navbar-left" role="search" action="{:U('Index/search')}" method="get">
                <div class="form-group">
                    <input type="text" class="form-control" name="keyword" placeholder="Search">
                </div>
            </form>
            <if condition="$Think.session.uid eq null" >
                <ul class="nav navbar-nav navbar-right">
                    <li  id="tab_7">
                        <a href="{:U('User/login')}">
                            <b>登录</b>
                        </a>
                    </li>
                    <li id="tab_8">
                        <a href="{:U('User/rigister')}"><b>注册</b></a>
                    </li>
                </ul>
            </if>
            <if condition="$Think.session.uid neq null">
                <ul class="nav navbar-nav navbar-right">
                    <li id="tab_5">

                        <a href="{:U('notice/index')}">
                            <i class="icon-envelope"></i>
                            <span id="">1</span>
                        </a>
                    </li>
                    <li class="dropdown" id="tab_6">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                            <b>{$Think.session.uid}</b>
                            <span class="caret"></span>
                        </a>
                        <ul class="dropdown-menu" role="menu">
                            <li>
                                <a href="{:U('User/info')}"><b>个人网页</b></a>
                            </li>
                            <li>
                                <a href="{:U('Home/User/set')}"><b>设置</b></a>
                            </li>
                            <if condition="$Think.session.uid eq root">
                                <li>
                                    <a href="{:U('Home/Admin/index')}"><b>后台管理</b></a>
                                </li>
                            </if>
                            <li class="divider"></li>
                            <li>
                                <a href="{:U('User/logout')}"><b>退出</b></a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </if>
        </div>
        <!-- /.navbar-collapse -->
    </div>
    <!-- /.container-fluid -->
</nav>